// 接口

import request from '@/utils/request'
/**
 * 新增部门
 * @param {code,introduce,manager,name,pid} data 
 */
export function addDepartments(data) {
   return request({
       url:'/company/department',
       method:'post',
       data
   })

}



/**
 * 查询企业的部门列表
 * @param  data 
 */
 export function getDepartments() {
    return request({
        url:'/company/department',
        method:'get',
        
    })
 
 }


/**
 *  根据ID修改部门详情
 * @param {code,introduce,manager,name,pid,id} data 
 */
 export function updataDepartments(data) {
    return request({
        url:`/company/department/${data.id}`,
        method:'put',
        data
    })
 
 }


 /**
 *   根据ID删除部门
 * @param {id} 
 */
  export function delDepartments(id) {
    return request({
        url:`/company/department/${id}`,
        method:'delete',
        
    })
 
 }

 /**
 * 根据ID查询部门详情
 * @param {id} 
 */
  export function getDepartmentDetail(id) {
    return request({
        url:`/company/department/${id}`,
        method:'get',
     
    })
 
 }
